package it.koutifaris.travianmap.dal.sqlservices;

import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;

public class AbstractMapDbTest extends AndroidTestCase {

	protected static final String SERVER_ID = "testserver";
	private static final String DELEGATING_CONTEXT_PREFIX = "test_";
	private SqlMapDbHelper dbHelper;

	@Override
	final public void setUp() throws Exception {
		dbHelper = new SqlMapDbHelper(new RenamingDelegatingContext(getContext(), DELEGATING_CONTEXT_PREFIX), SERVER_ID);
		overridableSetUp();
	}

	protected void overridableSetUp() throws Exception {
	}

	protected SqlMapDbHelper getDbHelper() {
		return dbHelper;
	}

	@Override
	final public void tearDown() throws Exception {
		overridableTearDown();
		dbHelper.close();
	}

	protected void overridableTearDown() {
	}

}
